package salary.calculation.common.exception;

import salary.calculation.common.enumerate.CommonResponseEnum;
import salary.calculation.common.enumerate.IResponseEnum;

public class BaseException extends RuntimeException{
    private static final long serialVersionUID = 1L;

    private IResponseEnum responseEnum;
    private Object[] args;

    public BaseException(IResponseEnum responseEnum, Object[] args, String msg, Throwable cause) {
        super(msg, cause);
        this.responseEnum = responseEnum;
        this.args = args;
    }

    public BaseException(IResponseEnum responseEnum, Object[] args, String msg) {
        super(msg);
        this.responseEnum = responseEnum;
        this.args = args;
    }

    public BaseException(IResponseEnum responseEnum) {
        this.responseEnum = responseEnum;
    }

    public BaseException(CommonResponseEnum serverError, String msg) {
        super(msg);
        this.responseEnum = responseEnum;
    }

    public IResponseEnum getResponseEnum() {
        return responseEnum;
    }

    public Object[] getArgs(){
        return args;
    }
}
